package com.lill.workflow.constant;

import java.util.HashMap;
import java.util.Map;

public enum BusinessType {

	CAR_SALE("car_sale","购车合同");
	private String val;
	private String content;
	
	private BusinessType(String val, String content) {
		this.val = val;
		this.content = content;
	}
	
	public String getVal() {
		return val;
	}
	public void setVal(String val) {
		this.val = val;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}

	public static String getContent(String val){
		String content = "";
		BusinessType[] values = BusinessType.values();
		for (int i = 0; i < values.length; i++) {
			if (values[i].getVal().equals(val)) {
				content = values[i].getContent();
				break;
			}
		}
		return content;
	}

	public static Map<String,Object> getList(){
		Map<String,Object> map = new HashMap<>();
		BusinessType[] values = BusinessType.values();
		for (int i = 0; i < values.length; i++) {
			String val = values[i].getVal();
			map.put(val,getContent(val) );
		}
		return map;
	}
	
}
